package angels.client.Entities;
import org.json.JSONException;
import org.json.JSONObject;
import com.google.android.maps.GeoPoint;

public class User {
	private String name;
	private String desc;
	private GeoPoint coords;
	private String imageURL;
	private float rating;
	
	
	public User(JSONObject json_robots) throws JSONException {	
		name = json_robots.getString("user");
		desc = json_robots.getString("desc");
		imageURL=json_robots.getString("pic");
		rating = Float.parseFloat(json_robots.getString("rat"));
		String[] xy =json_robots.getString("loc").split(",");
	    coords = new GeoPoint(
	            (int) (Double.parseDouble(xy[0]) * 1E6),
	            (int) (Double.parseDouble(xy[1]) * 1E6)
	    );
	}
	
	public String getName(){
		return name;
	}
	
	public String getDescription(){
		return desc;
	}
	
	public GeoPoint getCoords(){
		return coords;
	}
	
	public String getImageURL(){
		return imageURL; 
	}
	
	public float getRating(){
		return rating;
	}
}